mergeInto(LibraryManager.library, {
    Web_GetCurrentDomain: function (content) {
        var domain = location.protocol + '//' + window.location.host;
		var length = lengthBytesUTF8(domain) + 1;
        var buffer = _malloc(length);
        stringToUTF8(domain, buffer, length);
        return buffer;
    },
	
	Web_GetCurrentFullURL: function (content) {
        var url = window.location.href;
		var length = lengthBytesUTF8(url) + 1;
        var buffer = _malloc(length);
        stringToUTF8(url, buffer, length);
        return buffer;
    },
	
	Web_GetAllURLParameters: function (content) {
        var urlParams = new URLSearchParams(window.location.search);
        var params = {};
        for (let [key, value] of urlParams.entries()) {
            params[key] = value;
        }
        var jsonString = JSON.stringify(params);
		var length = lengthBytesUTF8(jsonString) + 1;
        var buffer = _malloc(length);
        stringToUTF8(jsonString, buffer, length);
        return buffer;
    },
    
    //获取浏览器视口宽度
    Web_GetWindowInnerWidth: function () {
        return window.innerWidth;
    },
    
    //获取浏览器视口高度
    Web_GetWindowInnerHeight: function () {
        return window.innerHeight;
    },
});